use std::path::PathBuf;

use input_method::core::{dag, dag_params::DefaultDagParams};
pub mod utils;

fn main() {
    let data_path_base = "data";
    let char_dict_path: PathBuf = [data_path_base, "dag_char.json"].iter().collect();
    let phrase_dict_path: PathBuf = [data_path_base, "dag_phrase.json"].iter().collect();
    let char_dict = utils::load_dict(char_dict_path.to_str().unwrap());
    let phrase_dict = utils::load_dict(phrase_dict_path.to_str().unwrap());
    let dag_params = &DefaultDagParams::new(char_dict, phrase_dict);
    let pinyin_list = vec![
        "ti", "chu", "le", "bu", "cuo", "de", "jie", "jve", "fang", "an",
    ]
    .into_iter()
    .map(|s| s.to_string())
    .collect::<Vec<String>>();
    let res = dag::dag(dag_params, &pinyin_list, 1, false);
    println!("{:?}", res);
}
